package com.thrd.taiexhibition.presener;

import com.thrd.taiexhibition.bean.BeanHotActivityList;
import com.thrd.taiexhibition.callback.MvpCallback;
import com.thrd.taiexhibition.model.CityHotSpotModel;
import com.thrd.taiexhibition.view.CityHotSpotView;

/**
 * @author: ${唐杰}
 * @date: 2021/3/25
 */
public class CityHotSpotPresener {
    private CityHotSpotModel mCityHotSpotModel;
    private CityHotSpotView mCityHotSpotView;

    public CityHotSpotPresener(CityHotSpotView mCityHotSpotView){
        this.mCityHotSpotView=mCityHotSpotView;
        this.mCityHotSpotModel=new CityHotSpotModel();
    }

    public void getCityFocusData(long cityId){
        mCityHotSpotModel.getCityFocusData(cityId, new MvpCallback<BeanHotActivityList>() {
            @Override
            public void onSuccess(BeanHotActivityList beanHotActivityList) {
                mCityHotSpotView.onSuccess(beanHotActivityList);
            }

            @Override
            public void onFailed(String e, int code) {
                mCityHotSpotView.onError(e,code);
            }
        });
    }
}
